package com.cloudlinkin.util;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 异步工具类
 * @author Administrator
 *
 */
@Component
public class ThreadUtils {

	@Value("${threadUtils.thread_count}")
	private int threadCount;


	private static final Logger log = Logger.getLogger(ThreadUtils.class);

	private static final ThreadPool pool = new ThreadPool(ThreadPool.THREAD_TYPE_FIXED, 50, null, null);


	public static void runTask(Runnable runnable) {
		try {
			pool.run(runnable);
		} catch (Exception e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
			log.info("", e);

		}
	}

}
